
#ifndef _PROCESS_H_
#define _PROCESS_H_

#include <memory.h>
#include <signal.h>
#include <pthread.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <dirent.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>

#define PROCES             "/proc"
#define SIZE               1024
#define MAX_PROC_NAME      80

/*进程结构体定义,保存从配置文件里读到的信息*/
struct proc_struct
{
    char process_name[MAX_PROC_NAME];
    int  pid; 
};

int creat_daemon();
int check_proc(struct proc_struct* array);
int proc_find(struct proc_struct* procl ,struct proc_struct* proc);
int get_proc(unsigned char *pu1FileName, unsigned char *pu1SearchStr, struct proc_struct* array,int size);
int startProc(struct proc_struct* proc, int must_run_size);
int moniter_run(struct proc_struct *must_run_proc, int proc_size);
void run_moniter(char *filename);
void exit_proc(int sig);
#endif